
#include "displaylist.h"

#include <assert.h>

GLuint DisplayList_Create(void (*DisplayCall)(void*),void* params)
{
    GLuint list;
    list = glGenLists(1);
    assert(list != 0);
    /* remplissage de la liste */
    glNewList(list, GL_COMPILE); 
	DisplayCall(params);
    glEndList(); 
	return list;
}

void DisplayList_Destroy(GLuint displayList)
{
	 glDeleteLists(displayList, 1);
}

void DisplayList_Draw(GLuint displayList)
{
	glPushMatrix();
    glCallList(displayList);
	glPopMatrix();
}